<!doctype html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
<head>
    <%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
    <%
        String path = request.getContextPath();
    %>
    <%@ include file="/WEB-INF/views-jsp/include/taglib/taglib.jsp" %>
    <%@ include file="/WEB-INF/views-jsp/include/meta/meta.jsp" %>
    <%@ include file="/WEB-INF/views-jsp/include/link/link.jsp" %>
    <%@ include file="/WEB-INF/views-jsp/include/script/script.jsp" %>
    <link rel="stylesheet" type="text/css" href="${path}/html/js/js-resource/imgPreview/css/style.css"/>
    <script type="text/javascript" src="${path}/html/js/jquery.form.js"></script>
    <script type="text/javascript" src="${path}/html/js/js-jsp/uploadFile.js?v=<%out.print(Math.random());%>"></script>
    <script type="text/javascript" src="${path}/html/js/js-resource/imgPreview/js/lightBox.js"></script>
    <script type="text/javascript" src="${path}/html/js/js-jsp/st/purchaseApply/purchaseApplyOption.js?v=<%out.print(Math.random());%>"></script>
    <script type="text/javascript" src="${path}/html/js/js-jsp/common/select-plugin.js"></script>
    <script>
        var purchaseDetailList = ${purchaseDetailList}+"";
    </script>
</head>
<body>
<div class="place">
    <span>当前位置：</span>
    <ul class="placeul">
        <li><a href="${path}/purchaseApply/index.do" style="background: transparent; border: none;">采购申请管理</a></li>
        <li>
            <c:if test="${null == purchaseApply.purId}">
                <a style="background: transparent; border: none;">添加采购申请</a>
            </c:if>
            <c:if test="${null != purchaseApply.purId}">
                <a style="background: transparent; border: none;">编辑采购申请</a>
            </c:if>
        </li>
    </ul>
</div>
<form id="operate_form" name="operate_form" class="form" method="post" action="#" enctype="multipart/form-data">
    <div class="formbody gridFrom">
        <div class="formtitle"><span>基本信息</span></div>
        <dl>
            <dd>
                <input type="hidden" name="purId" id="purId" value="${purchaseApply.purId}" />
                <input type="hidden" name="coId" id="coId" value="${purchaseApply.contract.coId}" />
                <input type="hidden" name="pfId" id="pfId" value="${purchaseApply.purchaseFile.pfId}" />
                <span class="title" style="width:120px;">归属合同：</span>
                <select class="easyui-combobox" id="contractList" ${purchaseApply.checkState != 3 ? 'hidden="false"' : 'disabled="disabled"'} name="contractList" validType="selectNotEmpty['归属合同']" style="width:255px; height: 32px" editable="false"></select>
            </dd>
            <dd>
                <span class="title" style="width:120px;">请购类型：</span>
                <select class="easyui-combobox" id="purType" name="purType" style="width:255px; height: 32px" ${purchaseApply.checkState != 3 ? 'hidden="false"' : 'disabled="disabled"'} validType="selectNotEmpty['请购类型']" editable="false" value="${purchaseApply.purType}">
                    <option value="" ${purchaseApply.purType == '' ? 'selected="selected"':''}>--请选择--</option>
                    <option value="1" ${purchaseApply.purType == 1 ? 'selected="selected"':''}>合同内</option>
                    <option value="2" ${purchaseApply.purType == 2 ? 'selected="selected"':''}>合同外</option>
                </select>
            </dd>
            <dd>
                <span class="title" style="width:120px;">上报状态：</span>
                <input type="hidden" id="reportState" name="reportState" value="${purchaseApply.reportState}">
                <select class="easyui-combobox" disabled="disabled" id="reportStateDisable" name="reportStateDisable" validType="selectNotEmpty['上报状态']" style="width:255px; height: 32px"  editable="false" value="${purchaseApply.reportState}">
                    <option value="1" ${purchaseApply == null||purchaseApply == undefind ? 'selected="selected"' : ''}>未上报</option>
                    <option value="2" ${purchaseApply.reportState == 2 ? 'selected="selected"' : ''}>已上报</option>
                </select>
            </dd>
            <dd>
                <span class="title" style="width:120px;">审核状态：</span>
                <input type="hidden" id="checkState" name="checkState" value="${purchaseApply.checkState}">
                <select class="easyui-combobox" id="checkStateDisable" disabled="disabled" name="checkStateDisable" validType="selectNotEmpty['审核状态']" style="width:255px; height: 32px"  editable="false" value="${purchaseApply.checkState}">
                    <option value="0" ${purchaseApply == null||purchaseApply == undefind ? 'selected="selected"' : ''}>未审核</option>
                    <option value="1" ${purchaseApply.checkState == 1 ? 'selected="selected"' : ''}>审核中</option>
                    <option value="2" ${purchaseApply.checkState == 2 ? 'selected="selected"' : ''}>已通过</option>
                    <option value="3" ${purchaseApply.checkState == 3 ? 'selected="selected"' : ''}>已驳回</option>
                </select>
            </dd>
            <%--<dd>
                <span class="title" style="width:120px;">请购日期：</span>
                <input class="easyui-datebox" name="purDate" id="purDate" data-options="required:'true',prompt:'请输入请购日期',editable:false" value="<fmt:formatDate value="${purchaseApply.purDate}" pattern="yyyy-MM-dd"/>" missingMessage="请购时间不能为空" style="width:255px; height: 32px" />
            </dd>--%>
            <dd>
                <span class="title" style="width:120px;">请购人：</span>
                <input class="easyui-textbox" type="text" name="purPerson" ${purchaseApply.checkState != 3 ? 'hidden="false"' : 'disabled="disabled"'} data-options="required:'true',prompt:'请输入请购人', validType:'length[1,5]'" missingMessage="请购人不能为空"  id="purPerson" value="${purchaseApply.purPerson}" style="width:255px; height: 32px">
            </dd>
            <dd>
                <span class="title" style="width:120px;">附件上传：</span>
                <input class="easyui-filebox"  id="uploadfile" name="uploadfile"  data-options="buttonText:'选择上传',prompt:'请选择上传附件', onChange:function(){ $('#uploadBtn').linkbutton({ disabled:false }) }" missingMessage="附件必须上传" value="" style="width:255px; height: 30px" />
                <a id="uploadBtn" class="easyui-linkbutton" style="width:55px; height: 28px" > 上传 </a>
                <a id="browseBtn" class="easyui-linkbutton" style="width:60px; height: 28px"> 浏览 </a>
                <!--以下属于上传附带参数-->
                <input type="hidden" id="oldFileId" name="oldFileId" value="${purchaseApply.commonFile.fileId}" />
                <input type="hidden" id="fileId" name="fileId" value="${purchaseApply.commonFile.fileId}" />
                <input type="hidden" name="fkType" value="PURCHASEAPPLYFILE" />
                <input type="hidden" name="modelName" value="仓储板块" />
                <input type="hidden" name="modelCode" value="ST" />
                <input type="hidden" name="funName" value="采购申请附件" />
                <input type="hidden" name="funCode" value="purchaseApplyFile" />
                <input type="hidden" id="fileName" name="fileName" value="${purchaseApply.commonFile.name}" />
                <input type="hidden" id="url" name="url" value="${purchaseApply.commonFile.url}" />
                <input type="hidden" id="size" name="size" />
                <input type="hidden" id="fix" name="fix" />
                <input type="hidden" id="md5" name="md5" />
            </dd>
            <dd>
                <span class="title" style="width:120px; vertical-align: top">备注信息：</span>
                <input class="easyui-textbox" name="remark" id="remark" data-options="multiline:true,prompt:'请输入备注信息', validType:'length[1,200]'" value="${purchaseApply.remark}" style="width:255px;height:100px">
            </dd>
        </dl>
    </div>
</form>
<div class="formbody" style="margin-left: 150px">
    <a id="optionPurchaseApply" class="easyui-linkbutton c1" style="width:100px; height: 35px">保存</a>
    &nbsp;&nbsp;&nbsp;
    <a href="${path}/purchaseApply/index.do" class="easyui-linkbutton c1" style="width:100px; height: 35px">取消</a>
</div>
</body>
<script>
    jQuery(document).ready(function($) {
        $.LightBox({speed:500});
    });
</script>
</html>